package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.dao.entity.StoreUser;

import java.util.List;

public interface StoreUserService extends IService<StoreUser> {


    default StoreUser getOnly(QueryWrapper<StoreUser> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default StoreUser getOnly(LambdaQueryWrapper<StoreUser> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }
    boolean addInfo(Long userId,Integer storeId,Integer role);
    boolean upInfo(Integer id, Long userId,Integer storeId,Integer role);

    /**
     * 获取商家拥有的店铺id
     */

    List<Integer> getStoreIdByUserId(Long userId);

    // 获取店铺拥有者userId
    Long getStoreOwnerUserId(Integer storeId);



}
